package com.example.qxglxt.controller;

import javax.annotation.Resource;

import com.example.qxglxt.dao.IRoleModulesDao;
import com.example.qxglxt.model.RoleModules;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/rolemodule")
public class RoleModulesContr {

    @Resource
    private IRoleModulesDao roleModulesDao;
    @ApiOperation(value = "分配权限",notes = "分配权限")
    @PutMapping("/AddUserToRole")
    public RoleModules addModules(@RequestBody RoleModules r){
         return roleModulesDao.save(r);
    }

    @ApiOperation(value = "删除权限",notes = "删除权限")
    @PostMapping("/delModules")
    public void delModules(@RequestBody RoleModules r){
        roleModulesDao.delete(r);;
        ;
    }
}